package com.kandinfo.isbnmanage.repository;

import java.util.Collection;
import java.util.List;

import org.springframework.data.jpa.repository.Query;

import com.kandinfo.base.common.repository.BaseRepository;
import com.kandinfo.isbnmanage.domian.IsbnManage;

public interface IsbnManageRepository extends BaseRepository<IsbnManage, Long> {

	@Query(value=" SELECT im.* FROM isbn_manage im,isbn_information ii WHERE im.barcode = ii.barcode AND ii.id IN ?1 " ,nativeQuery=true)
	List<IsbnManage> getIsbnManageByInfoId(Collection<Long> refKeyList);

	@Query(value=" SELECT im.* FROM isbn_manage im where im.barcode = ?1 " ,nativeQuery=true)
	IsbnManage getByBarcode(String barcode);

	@Query(value=" SELECT im.* FROM isbn_manage im where im.barcode in ?1 " ,nativeQuery=true)
	List<IsbnManage> findByBarcode(Collection<String> barcodeList);

}
